package chapter10;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/3/9 14:40
 */
public class Parcel11 {
    public static Destination destination(String s) {
        return new ParcelDestination(s);
    }

    public static Contents contents() {
        return new ParacelContents();
    }

    public static void main(String[] args) {
        Contents c = contents();
        Destination d = destination("Tasmania");
    }

    private static class ParacelContents implements Contents {
        private int anInt = 11;

        @Override
        public int value() {
            return anInt;
        }
    }

    protected static class ParcelDestination implements Destination {
        static int x = 10;
        private String label;

        public ParcelDestination(String label) {
            this.label = label;
        }

        public static void f() {
        }

        @Override
        public String readLabel() {
            return label;
        }

        static class AnotherLevel {
            static int x = 10;

            public static void f() {
            }
        }
    }
}
